﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using Rarous.TexyNet;
using Rarous.Gryphoon.Text;

namespace Rarous.Gryphoon.Spec.Engine {
  public class ArticlesSpec {

    private ArticleFactory factory;

    public ArticlesSpec() {
      factory = new ArticleFactory(new TextUtility());
    }

    [Fact]
    public void ShouldCreateArticle() {
      string name = "title";
      string perex = "article perex";
      string articleText = "some article text";

      Article article = factory.Create(name, perex, articleText);

      Assert.NotNull(article);
      Assert.Equal("title", article.Name);
      Assert.Equal("title", article.Url);
      Assert.Equal("article perex", article.Perex);
      Assert.Equal("some article text", article.Text);
      Assert.Equal("<p>some article text</p>", article.Html);
    }
  }
}
